﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace hoadon
{
    class HoaDonDAL
    {
        public HoaDonDAL()
        {

        }
        public void ThemHoaDon(string hoadon, string mahang, string diengiai,
                          double soluong, double dongia, double trigia, double khuyenmai)
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = "Data Source=(local);Initial Catalog=qlvt; User Id=sa; Password=sa";
            conn.Open();
            SqlCommand cmd = new SqlCommand("insert into hoadon values('" + hoadon.ToString() + "','" + mahang.ToString() + "'," + soluong + "," + dongia + "," + trigia + "," + khuyenmai + ",N'" + diengiai.ToString() + "')", conn);
            cmd.ExecuteNonQuery();
        }

    }
}
